Public Class CS334
   Inherits CSSE

   Private _ScoreWritten As Boolean

   Sub New()

      _UnitRangeMin = 1
      _UnitRangeMax = 10
      _ScoreRangeMin = 60
      _ScoreRangeMax = 100

      Score = 60
      Unit = 5
      _ScoreWritten = False

      If _Score = _ScoreRangeMax Then
         PerfectScoreReached()
      End If

   End Sub

   Public Overrides Property Score()
      Get
         Return _Score
      End Get
      Set(ByVal value)

         If _ScoreWritten = False Then

            If value >= _ScoreRangeMin And value <= _ScoreRangeMax Then

               _Score = value
               _ScoreWritten = True

               If _Score = _ScoreRangeMax Then
                  PerfectScoreReached()
               End If

            Else

               Err.Raise(33402, "Score", "KarbassA::Value would be out of range!")

            End If

         Else

            Err.Raise(33403, "Score", "KarbassA::Score is write once!")

         End If

      End Set
   End Property
End Class